<%@page import="com.ereport.entity.BudgetPlanner"%>
<%@page import="java.util.List"%>
<div align="right">(in lacs)</div>
<% 
List<BudgetPlanner> bplist=(List<BudgetPlanner>)request.getAttribute("bplist");


%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                      <td width="100%"><div id="demo">
                          <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#ffffff" class="tablebox" id="infoTable" background="<%=application.getContextPath() %>/images/hed-bg-block.jpg" style="background-repeat:repeat-x; background-position:left top">
                            <thead>
                              <tr >
                              <th width="3%"  align="center" valign="middle" class="hed">&nbsp;</th>
                                <th width="26%"  align="center" valign="middle" class="hed">Customer</th>
                                <th width="22%"  align="center" valign="middle" class="hed">Location</th>
                                <th width="13%"  align="center" valign="middle" class="hed">T.E</th>
                                <th width="13%"  align="center" valign="middle" class="hed">C.P</th>
                                <th width="12%"  align="center" valign="middle" class="hed">F.E</th>
                                <th width="14%"  align="center" valign="middle" class="hed">Total</th>
                              </tr>
                            </thead>
                            <tbody>
                            <%
                            double grndTotal=0.0;
                            if(bplist!=null){
                            for(int i=0;i<bplist.size();i++){
								double total=bplist.get(i).getTe()+bplist.get(i).getCp()+bplist.get(i).getFe();
                            	grndTotal+=total;
                            %>
                              <tr>
                              	<td align="center" bgcolor="#CCCCCC"><input type="checkbox" name="checkbox" class="tdinput" value="checkbox" /></td>
                                <td align="center" bgcolor="#CCCCCC"><input type="text" name="org<%=i+1 %>" id="org_<%=i+1 %>" class="tdinput" value="<%=bplist.get(i).getOrgName() %>" /></td>
                                <td align="center" bgcolor="#CCCCCC"><input type="text" name="loc<%=i+1 %>" id="loc_<%=i+1 %>" class="tdinput" value="<%=bplist.get(i).getLocation() %>" /></td>
                                <td  bgcolor="#CCCCCC"><input type="text" name="te<%=i+1 %>" id="te_<%=i+1 %>" class="tdinput" value="<%=bplist.get(i).getTe() %>" /></td>
                                <td align="center" bgcolor="#CCCCCC"><input type="text" name="cp<%=i+1 %>" id="cp_<%=i+1 %>" class="tdinput" value="<%=bplist.get(i).getCp() %>" /></td>
                                <td align="center" bgcolor="#CCCCCC"><input type="text" name="fe<%=i+1 %>" id="fe_<%=i+1 %>" class="tdinput" value="<%=bplist.get(i).getFe() %>" onblur="javascript: gettotal(this)" /></td>
                                <td align="center" bgcolor="#CCCCCC"><input type="text" name="total<%=i+1 %>" id="total_<%=i+1 %>" class="tdinput" value="<%=total %>" readonly="readonly"/></td>
                              </tr>
                              <%
                              }
                            }else {
                            	
                              %>
                              <tr>
                              	<td align="center" bgcolor="#CCCCCC"><input type="checkbox" name="checkbox" class="tdinput" value="checkbox" /></td>
                                <td align="center" bgcolor="#CCCCCC"><input type="text" name="org1" id="org_1" class="tdinput" value="" /></td>
                                <td align="center" bgcolor="#CCCCCC"><input type="text" name="loc1" id="loc_1" class="tdinput" value="" /></td>
                                <td  bgcolor="#CCCCCC"><input type="text" name="te1" id="te_1" class="tdinput" value="" /></td>
                                <td align="center" bgcolor="#CCCCCC"><input type="text" name="cp1" id="cp_1" class="tdinput" value="" /></td>
                                <td align="center" bgcolor="#CCCCCC"><input type="text" name="fe1" id="fe_1" class="tdinput" value="" onblur="javascript: gettotal(this)" /></td>
                                <td align="center" bgcolor="#CCCCCC"><input type="text" name="total1" id="total_1" class="tdinput" value="" readonly="readonly"/></td>
                              </tr>
                            	  
                              <%} %>
                            </tbody>
                          </table>
                      </div></td>
                   			 </tr>
                   			 <tr>
                    			<td align="right" bgcolor="#CCCCCC">
                    			<table width="100%" border="0" cellpadding="0" cellspacing="0">
                    			<tr>
                              <td align="center" bgcolor="#CCCCCC">&nbsp;</td>
                                <td align="center" bgcolor="#CCCCCC">&nbsp;</td>
                                <td align="center" bgcolor="#CCCCCC">&nbsp;</td>
                                <td  bgcolor="#CCCCCC"></td>
                                <td align="center" bgcolor="#CCCCCC">&nbsp;</td>
                                <td align="right" bgcolor="#CCCCCC">&nbsp;Grand Total:</td>
                                <td align="right" valign="middle" width="11%" bgcolor="#CCCCCC">
                                <input type="text" align="middle" name="grdtotal" id="grdtotal" class="tdinput" value="<%=grndTotal %>" readonly="readonly"/></td>
                              </tr>
                              </table>
                    			</td>
                                
                              </tr>
                    <tr>
                      <td height="10" align="left" valign="top"><table width="599" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                          <td width="30"  ><a href="javascript: addRow('infoTable')" style="font-size:24px; font-weight:bold" title="Add Row">+</a></td>
                          <td width="30"  ><a href="javascript: deleteRow('infoTable')"  style="font-size:24px; font-weight:bold" title="Delete Row">-</a></td>
                          <td width="359" >&nbsp;</td>
                          <td width="30" align="right">&nbsp;</td>
                          <td width="30" align="right">&nbsp;</td>
                        </tr>
                       
                      </table></td>
                    </tr>
                    <tr>
                      <td align="left" valign="top">
                      	<input type="reset" class="button-black-right" value="Cancel"/>
                      	<input type="submit" class="button-black-right" value="Save"/>
                      </td>
                    </tr>
                    <tr>
                      <td align="left" valign="top">&nbsp;<input type="hidden" name="rCount" id="rCount" value="<%= bplist.size()%>"/></td>
                      
                    </tr>
                </table>
